GateOR=function(){
draw2d.ImageFigure.call(this,"circuit/images/" + this.type+".png");
this.outputPort=null;
this.inputPort1=null;
this.inputPort2=null;
this.setDimension(100, 50);
};
GateOR.prototype=new draw2d.ImageFigure();
GateOR.prototype.type="OR";
GateOR.prototype.setWorkflow=function(workflow){
	draw2d.ImageFigure.prototype.setWorkflow.call(this,workflow);
	if(workflow!=null&&this.inputPort1==null){
		this.inputPort1=new InputPort();
		this.inputPort1.setId(portCnt++);
		addInputPort(this.inputPort1.getId()+"");
		this.inputPort1.setLabel(this.inputPort1.getId());
		this.inputPort1.setName("input");
		this.inputPort1.setWorkflow(workflow);
		this.inputPort1.setBackgroundColor(new draw2d.Color(115,115,245));
		this.addPort(this.inputPort1,0,this.height/3);
	}
	if(workflow!=null&&this.inputPort2==null){
		this.inputPort2=new InputPort();
		this.inputPort2.setId(portCnt++);
		addInputPort(this.inputPort2.getId()+"");
		this.inputPort2.setLabel(this.inputPort2.getId());
		this.inputPort2.setName("input");
		this.inputPort2.setWorkflow(workflow);
		this.inputPort2.setBackgroundColor(new draw2d.Color(115,115,245));
		this.addPort(this.inputPort2,0,2*(this.height/3));
	}
	if(workflow!=null&&this.outputPort==null){
		this.outputPort=new OutputPort();
		this.outputPort.setId(portCnt++);
		addOutputPort(this.outputPort.getId()+"");
		this.outputPort.setLabel(this.outputPort.getId());
		this.outputPort.setMaxFanOut(5);
		this.outputPort.setWorkflow(workflow);
		this.outputPort.setName("output");
		this.outputPort.setBackgroundColor(new draw2d.Color(245,115,115));
		this.addPort(this.outputPort,this.width,this.height/2);
	}
	
	addPortEquation(this.outputPort.getId()+"", this.getEquation());
};
GateOR.prototype.getEquation=function(){
	var equationArr = new Array();
	equationArr[0] = this.inputPort1.getId() ;
	equationArr[1] = "+";
	equationArr[2] = this.inputPort2.getId();
	return equationArr;
};
